package com.xoa.service.officePara.impl;

import com.xoa.dao.officePara.OfficeParaMapper;
import com.xoa.model.officePara.OfficePara;
import com.xoa.service.officePara.OfficeParaService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@Service
public class OfficeParaServiceImpl implements OfficeParaService {
    @Resource
    private OfficeParaMapper officeParaMapper;
    @Override
    public ToJson<OfficePara> updateOfficePara(HttpServletRequest request, OfficePara officePara) {
        ToJson<OfficePara> toJson = new ToJson<>(1,"err");
        try {
            int a = officeParaMapper.updatePara(officePara);
            if (a>0){
                toJson.setMsg("更新成功");
                toJson.setFlag(0);
            }else {
                toJson.setMsg("更新失败");
                toJson.setFlag(1);
            }

        }catch (Exception e){
            e.printStackTrace();
        }
        return toJson;
    }
}
